import request from '@/utils/request'

// 查询报修单列表
export function listRepair(query) {
  return request({
    url: '/it/repair/list',
    method: 'get',
    params: query
  })
}

// 查询我的报修单列表
export function listMyRepair(query) {
  return request({
    url: '/it/repair/listMyRepair',
    method: 'get',
    params: query
  })
}

// 查询我的维修工单列表
export function listMyService(query) {
  return request({
    url: '/it/repair/listMyService',
    method: 'get',
    params: query
  })
}

// 查询报修单详细
export function getRepair(id) {
  return request({
    url: '/it/repair/' + id,
    method: 'get'
  })
}

// 新增报修单
export function addRepair(data) {
  return request({
    url: '/it/repair/save',
    method: 'post',
    data: data
  })
}

// 修改报修单
export function editRepair(data) {
  return request({
    url: '/it/repair/update',
    method: 'put',
    data: data
  })
}

// 报修单指派
export function repairAssign(data) {
  return request({
    url: '/it/repair/repairAssign',
    method: 'put',
    data: data
  })
}

// 报修单解决回复
export function repairResolved(data) {
  return request({
    url: '/it/repair/repairResolved',
    method: 'put',
    data: data
  })
}

// 报修单解决回复
export function repairComment(data) {
  return request({
    url: '/it/repair/repairComment',
    method: 'put',
    data: data
  })
}

// 删除报修单
export function delRepair(id) {
  return request({
    url: '/it/repair/remove/' + id,
    method: 'delete'
  })
}



// 导出报修单
export function exportRepair(query) {
  return request({
    url: '/it/repair/export',
    method: 'get',
    params: query
  })
}
